﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using GreatB2C.Utility;
using GreatB2C.Business;

namespace GreatB2C.Web.Manage.CRM.Contacter
{
    public partial class ContacterManage : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                BindGridView();
            }
        }

        private void BindGridView()
        {
            throw new NotImplementedException();
        }

        protected void gdvList_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            string commandName = e.CommandName.Trim();
            string contacterID = e.CommandArgument.ToString();

            try
            {
                GreatB2C.Model.Contacter contacter = new GreatB2C.Model.Contacter();
                contacter.ContacterID = Convert.ToInt32(contacterID);
                Business.Contacter contacterService = new GreatB2C.Business.Contacter();
                if (commandName == "DeleteCommand")
                {
                    if (true == contacterService.Delete(contacter))
                    {
                        //提示删除成功
                    }
                    else
                    { 
                        //提示删除失败
                    }
                }
            }
            catch (Exception ex)
            { 
                //
            }

            if (commandName == "ViewCommand")
            {
                Response.Redirect("");
            }

            if (commandName == "UpdateProgram")
            {
                Response.Redirect("");
            }
        }
    }
}
